﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SortOf;

namespace ExampleBinarySearchTree
{
    class Program
    {
        static void Main(string[] args)
        {
            BinarySearchTree<int> nums = new BinarySearchTree<int>();
            nums.insert(23);
            nums.insert(45);
            nums.insert(16);
            nums.insert(39);
            nums.insert(3);
            nums.insert(128);
            nums.insert(22);
            nums.insert(3);
            Console.WriteLine("Gesorteerd:");
            nums.InOrder(nums.root);

            Console.WriteLine();
            BinarySearchTree<Student> students = new BinarySearchTree<Student>();
            Student st1 = new Student("Geert", 12345);
            students.insert(st1);
            students.insert(new Student("Geoffrey", 12344));
            students.insert(new Student("Justin", 12343));
            students.insert(new Student("Geert", 12343));
            Console.WriteLine("Gesorteerd");
            students.InOrder(students.root);

            students.Delete(st1);
            Console.WriteLine();
            Console.WriteLine("1 Verwijderd");
            students.InOrder(students.root);
            Console.ReadKey();
        }
    }
}
